<script>
function checkform(){
	var subject=$('input[name="subject"]').val();
	if(trim(subject)==''){
		alert('请填写帮助主题!');
		return false;		
	}
	
	var add_time=$('#add_time').val();
	if(!firmTime(add_time)){
		alert('请正确填写发表时间!');
		return false;		
	}
	
	var flid=$('#flid').val();
	if(trim(flid)=='0'){
		alert('请选择帮助分类!');
		return false;		
	}
	
	var content = FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true );
	if(trim(content)==''){
		alert('请填写好产品描述!');
		return false;
	}
	commonEffection.setLoading();
	$('#addHelpForm').submit();
}
	upload.type='help';
	upload.formid='addHelpForm';
	upload.setAppend=function(imgurl){
		return '<div style="margin:10px"><a href="'+imgurl+'" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;border:1px #cccccc dashed" src="'+imgurl+'" /></a> 图片说明:<input type="text" name="imgIntro[]" value="" /><input type="hidden" name="imgUrl[]" value="'+imgurl+'" />　<input type="button" value="插入" onclick="commonEffection.InserImg(\''+imgurl+'\');" />　<input type="button" value="删除" onclick="upload.delimg(this);" /></div>';
	}
	
	fenleiEffection.type='help';
	fenleiEffection.optionString='请选择帮助分类';
</script>
<div class="frame_addfactoryDiv">
  <form name="addHelpForm" id="addHelpForm" enctype="multipart/form-data"  action="administrator<?=CHOSING_DE?>help<?=CHOSING_DE?>doadd" method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <td width="15%" class="ri-bbgg"><span class="red">*</span> 帮助主题：</td>
      <td width="85%" class="le">
	  	<input type="text" name="subject"  value="" id="subject">
	  </td>
    </tr>
	<tr>
      <td width="15%" class="ri-bbgg"><span class="red">*</span> 发表时间：</td>
      <td width="85%" class="le">
	  	<input type="text" name="add_time" value="<?=date('Y-m-d H:i:s',time())?>" id="add_time"> (0000-00-00 00:00:00)
	  </td>
    </tr>
	<tr>
		<td class="ri-bbgg"><span class="red">*</span> 帮助分类：</td>
		<td class="le">
			<div>
				<select id="flSelect" onchange="fenleiEffection.getChildFenlei(this);">
					<option value="0">请选择帮助分类</option>
					<?for($i=0;$i<count($this->fenleiArray);$i++):?>
					<option value="<?=$this->fenleiArray[$i]['flid']?>"><?=$this->fenleiArray[$i]['flname']?></option>
					<?endfor;?>
				</select>
			</div>
			<input type="hidden" value="0" id="flid" name="flid" />
		</td>
	</tr>
    <tr>
      <td class="ri-bbgg">帮助内容：</td>
      <td class="le">
        <div><?=$this->oFCKeditor->Create();?></div>
	  </td>
    </tr>
	<tr>
	  <td class="ri-bbgg"><span class="red">*</span> 上传图片：</td>
	  <td class="le"><span><input name="productpic" type="file" id="productpic" /></span>　<input type="button" onclick="upload.uploadimg(this);" value="上传" />　( 可连续上传多幅 )</td>
	</tr>
	<tr>
	  <td class="ri-bbgg">图片效果：</td>
	  <td class="le">
		<div id="productImages"></div>
		<iframe id="productIframe" width="0" height="0" name="productIframe"></iframe>
	  </td>
	</tr>
    <tr>
      <td colspan="2" class="se" align="center">
        <input name="button2" type="button" class="iput" value="保 存"   onclick="checkform();" />　　
        <input name="button" type="button" class="iput" value="返 回" onclick="commonEffection.confirmBack();" />
      </td>
    </tr>
  </table>
</div>
